<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%@page import="com.lmpop.trade.ti_member.Ti_memberInfo"%>
<%@page import="com.lmpop.trade.ts_area.Ts_areaInfo"%>
<%@page import="com.lmpop.trade.ti_company.Ti_companyInfo"%>

<%
 
 	request.setCharacterEncoding("utf-8");
	Map ti_member = new Hashtable();
	ti_member.put("m_state","c");	
 	String cat_attr="",info_id="",flag="";
	if(request.getParameter("cat_attr") != null) {
		 cat_attr = request.getParameter("cat_attr").trim();
		 ti_member.put("class_attr",cat_attr);	
	}
	if(request.getParameter("info_id") != null) {
		 info_id = request.getParameter("info_id").trim();
	}
	if(request.getParameter("flag") != null) {
		 flag = request.getParameter("flag").trim();
	}
	Ti_companyInfo companyInfo=new Ti_companyInfo();
    String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List glist = companyInfo.getListByPage(ti_member,Integer.parseInt(iStart),limit);
	int counter = companyInfo.getCountByObj(ti_member);
	String pageString = new PageTools().getGoogleToolsBar(counter,"showMoreCompany.jsp?iStart=",Integer.parseInt(iStart),limit);
  	Ts_areaInfo areaBean = new Ts_areaInfo();
   %>     
<html>

    <head>
        <meta http-equiv="x-ua-compatible" content="ie=7" />
        <title>more college</title>
        <link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
        <link href="/program/admin/index/css/thickbox.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="/js/thickbox.js"></script>
        <script src="/program/admin/teambuy/index.js" type="text/javascript"></script>
    </head>

    <body>
    
	<div style="width:600px;">
		   <table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
				<tr>
					<th>企业名称</th>
			  		<th>联系人</th>
					<th>手机</th>
					<th>地址</th>
				</tr>
				<% 
		     int listsize=0;
		     if(glist!=null && glist.size()>0){
		        listsize =  glist.size();    
		        String areaArr[]=null; 
		        for(int i = 0;i < listsize;i++){ 
		        	Hashtable gMap =(Hashtable)glist.get(i);
		        	String cust_id="",cust_name="",contact_name="",contact_cellphone="",phone="",area_attr="",areaAttr="",company_addr="",website="";
		        	if (gMap.get("cust_id") != null){
							cust_id = gMap.get("cust_id").toString();
						}
						if (gMap.get("cust_name") != null){
							cust_name = gMap.get("cust_name").toString();
						}
						if (gMap.get("contact_name") != null){
							contact_name = gMap.get("contact_name").toString();
						}
						if (gMap.get("contact_cellphone") != null){
							contact_cellphone = gMap.get("contact_cellphone").toString();
						}
						if (gMap.get("phone") != null){
							phone = gMap.get("phone").toString();
						}  
						if (gMap.get("company_addr") != null){
							company_addr = gMap.get("company_addr").toString();
						}  
						if (gMap.get("website") != null){
							website = gMap.get("website").toString();
						}  
						if(gMap.get("area_attr")!=null&&gMap.get("area_attr").toString()!=null) {
							area_attr = gMap.get("area_attr").toString();
							areaArr = area_attr.split("\\|");
							if(areaArr.length>=1)
								areaAttr = areaBean.getAreaNameById( areaArr[0])+"省";
							if(areaArr.length>=2)
								areaAttr += areaBean.getAreaNameById( areaArr[1])+"市";
							if(areaArr.length>=3)
								areaAttr += areaBean.getAreaNameById( areaArr[2]);
						}
						areaAttr +=company_addr;
						
		   	%>		
				<tr>
					<td>
						<a href="javascript:linkCompanyOpr('<%=flag %>','<%=info_id %>','<%=cust_id%>','<%=cust_name%>','<%=areaAttr%>','<%=phone%>','<%=website%>')"><%=cust_name%></a>
					</td>
				  	<td><%=contact_name%></td>
				  	<td><%=phone%></td>
				  	<td><%=areaAttr%></td>
				</tr>
				<%
		   			}	  
			  	}
			  %>  
			</table> 
		</div>
    </body>
</html>
